From: "Stefan Stuntz"Date: Mon, 24 Jun 1996 19:23:38 +0100 X-Mailer: IntuiNews 1.3b Beta 7 (2.2.96) Subject: Re: OM_SET and Scrollbar problem Message-ID: <81322825@magic.informatik.tu-muenchen.de> Organization: Home of MUI Resent-Message-ID: <"sTB4g3.0.GS6.Dikpn"@susi> Resent-From: mui@sunsite.Informatik.RWTH-Aachen.de Reply-To: mui@sunsite.Informatik.RWTH-Aachen.de X-Mailing-List: archive/latest/1629 X-Loop: mui@sunsite.informatik.rwth-aachen.de Precedence: list Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.de Content-Type: text Content-Length: 448 X-Lines: 20 Status: RO Rafal Mantiuk wrote > I created Scrollbar object in this way: > > (...) > Child, obj = ScrollbarObject, > MUIA_Prop_Visible, 5, > MUIA_Prop_Total, 20, > End, > (...) > > The problem is MUIA_Prop_Visible and MUIA_Prop_Total have no effect. > TAG_DONE );> after creation also doesn't work. Dont call OM_SET with DoMethod(), use SetAttrs() instead. -- Greetings, Stefan From: Chris_Sterne@panam.wimsey.com (Chris Sterne) To: mui@sunsite.Informatik.RWTH-Aachen.de Subject: OM_SET and Scrollbar problem Resent-Message-ID: <"iEnGK2.0.tT1.jceqn"@susi> Resent-From: mui@sunsite.Informatik.RWTH-Aachen.de Reply-To: mui@sunsite.Informatik.RWTH-Aachen.de X-Mailing-List: archive/latest/1651 X-Loop: mui@sunsite.informatik.rwth-aachen.de Precedence: list Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.de Content-Type: text Content-Length: 2445 X-Lines: 68 Status: RO >Rafal Mantiuk wrote >> I created Scrollbar object in this way: >> >> (...) >> Child, obj = ScrollbarObject, >> MUIA_Prop_Visible, 5, >> MUIA_Prop_Total, 20, >> End, >> (...) >> >> The problem is MUIA_Prop_Visible and MUIA_Prop_Total have no effect. >> > TAG_DONE );> after creation also doesn't work. >Dont call OM_SET with DoMethod(), use SetAttrs() instead. >-- >Greetings, Stefan Although Stefan Stuntz already answered the question, but I thought it may be helpful if I added a few comments of my own. I had also created a ScrollbarObject in one of my programs, and was suprised to find that the attributes passed during the object's creation were ignored. Although the Scrollbar class author decides on the behavior of the object's creation procedure, I believe the real reason has to do with what the ScrollbarObject actually is. As stated in the MUI autodocs, the Scrollbar class is just a Group containing a PropObject and two arrow buttons, with no attributes of its own. Since MUIA_Prop_Visible and MUIA_Prop_Total are not attributes of a Group object class, they have no effect. If the Scrollbar class was actually a sub-class of the Prop class, Prop class attributes (MUIA_Prop_Visible, etc.) would be inherited by the Scrollbar class, and would be used during object creation. It is therefore necessary to set the PropObject attributes after the ScrollbarObject is created, using: SetAttrs(ScrollbarObj, MUIA_Prop_Visible, 5, MUIA_Prop_Total, 20, ..., TAG_DONE); The SetAttrs() function constructs the following structure (see ROM Kernal reference manual-Libraries, page 305) from the attribute list, before sending it to the object class for processing: struct opSet { ULONG MethodID; /* Value of OM_SET */ struct TagItem *ops_AttrList; /* attribute/values array */ struct GadgetInfo *ops_GInfo; /* Special information for Gadgets */ } The following will not work, mainly because the class will incorrectly interpret MUIA_Prop_Visible as the pointer (ops_AttrList) to an array of attribute/values. DoMethod(ScrollbarObj, OM_SET, MUIA_Prop_Visible, 5, MUIA_Prop_Total, 20, TAG_DONE ); Regards, Chris Sterne. From: Chris_Sterne@panam.wimsey.com (Chris Sterne) To: mui@sunsite.Informatik.RWTH-Aachen.de Subject: PropObject redraw problem Resent-Message-ID: <"tW5BY2.0.oA2.SYgqn"@susi> Resent-From: mui@sunsite.Informatik.RWTH-Aachen.de Reply-To: mui@sunsite.Informatik.RWTH-Aachen.de X-Mailing-List: archive/latest/1652 X-Loop: mui@sunsite.informatik.rwth-aachen.de Precedence: list Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.de Content-Type: text Content-Length: 1419 X-Lines: 41 Status: RO I have encountered a problem with ScrollbarObjects and PropObjects when they are used in a Group custom layout hook (Simple Refresh window type). When the Scroller knob is exposed after being covered by another window, the knob image is drawn incorrectly. It appears as if the knob is drawn first, but is then obliterated by the PropObject background. If the ScrollbarObject or PropObject is not part of a custom layout hook, no problems are seen. The easiest way to duplicate this problem is to modify the "Layout.c" demo program that came with the MUI development package as follows: Replace the line: Child, b[7] = SimpleButton("rewarded!"), With the following: Child, b[7] = ScrollbarObject, MUIA_Group_Horiz, TRUE, End, Cover the small ScrollbarObject with another window. Then uncover the object and observe the object's state. I had originally asked Stefan Stuntz about this problem, but he was not able to duplicate the problem. There may be some factor (system OS or compiler) causing the problem. I was wondering if anyone else can duplicate it, or has a solution. System: Amiga 1200 with Workbench 3.0 Compiler: SAS/C V6.56 MUI Library: V3.3 (MUIMaster 14.106) Window Type: Simple Refresh I have tried a MUI development package downloaded from Aminet, as well as one from a registered copy of MUI. Thank you, Chris Sterne. From: "Stefan Stuntz" Date: Fri, 05 Jul 1996 00:20:16 +0100 X-Mailer: IntuiNews 1.4 (28.6.96) Subject: Re: Workbench-like Scrollbar object Message-Id: <81323281@magic.informatik.tu-muenchen.de> Organization: Home of MUI Resent-Message-ID: <"PANN41.0.X73.iK4tn"@susi> Resent-From: mui@sunsite.Informatik.RWTH-Aachen.de Reply-To: mui@sunsite.Informatik.RWTH-Aachen.de X-Mailing-List: archive/latest/1784 X-Loop: mui@sunsite.informatik.rwth-aachen.de Precedence: list Resent-Sender: mui-request@sunsite.Informatik.RWTH-Aachen.de Content-Type: text Content-Length: 592 X-Lines: 16 Status: RO Chris Sterne wrote in article <9607040549.AA07678@panam.wimsey.com>: > I wish to have a Scrollbar object that behaves like the scroller > in the border of a Workbench drawer window. Even though all window > contents are visible (the scroller knob is full size), it is > still possible to shift beyond the visible area by pressing the > scroller arrows. With the next MUI release, a scrollbar controls its propobject by sending it MUIM_Prop_Increase/Decrease methods. You can then write a subclass of propclass and do whatever you wish if one of these methods arrives. Greetings, Stefan